package serveur;

import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
import java.rmi.server.UnicastRemoteObject;

import partage.ServiceChat;

public class ServeurChat {

	/**
	 * @param args
	 * @throws Exception 
	 */
	public static void main(String[] args) throws Exception {
		Registry registry;
		  ServiceChat stub;
		  ServiceChatImpl service;

		  System.setProperty("java.rmi.server.hostname","localhost");
		  
		  service = new ServiceChatImpl();
		  stub = (ServiceChat) UnicastRemoteObject.exportObject(service,0);
		  
		  registry = LocateRegistry.createRegistry(3000);  
		  registry.bind("ServiceChat", stub);
		  
		  Thread t=new Thread(service);
			t.start();
			
		  //voir d'après tp_meteo-RMI
		  
		  
		  
		  System.out.println("Service enregistre");
	}

}
